package edu.zut.test;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

public class C3P0test {

    public static void main(String[] args) throws SQLException {
        //实例化基于c3p0的数据库连接池
        DataSource dataSource = new ComboPooledDataSource("mysql");
        //获取数据源中的连接
        Connection connection = dataSource.getConnection();
        System.out.println("connection = " + connection);
    }
}
